<?php
class HTTPRequest extends ArrayObject {	
	private $_answer;
	
	function __construct(){
		foreach ($_GET as $k => $v)
			$this[$k] = $v;
		foreach ($_POST as $k => $v)
			$this[$k] = $v;
		$this->_answer = array();
	}
	public function answer(array $array){
		$this->_answer = array_merge($this->_answer, $array);
	}
	
	function __destruct(){
		echo json_encode($this->_answer);
	}
}
?>